layui.use('element', function() {
	var element = layui.element;

	//获取hash来切换选项卡，假设当前地址的hash为lay-id对应的值
	var layid = location.hash.replace(/^#test1=/, '');
	element.tabChange('test1', layid); //假设当前地址为：http://a.com#test1=222，那么选项卡会自动切换到“发送消息”这一项

	//监听Tab切换，以改变地址hash值
	element.on('tab(test1)', function() {
		location.hash = 'test1=' + this.getAttribute('lay-id');
	});
});

		 window.onscroll= function(){
                //变量t是滚动条滚动时，距离顶部的距离
                var t = document.documentElement.scrollTop||document.body.scrollTop;
                var scrollup = document.getElementById('scrollup');
                //当滚动到距离顶部200px时，返回顶部的锚点显示
                if(t>=450){
                    scrollup.style.display="block";
                }else{          //恢复正常
                    scrollup.style.display="none";
                }
                
            }
		 
			let img1 = document.getElementById("img_1");
			let img2 = document.getElementById("img_2");
			let img3 = document.getElementById("img_3");
			let img4 = document.getElementById("img_4");
			let imgBig = document.getElementById("img_biggest");
			
			img1.onclick = function(){
				imgBig.src = img1.src;
				img1.style.border = "1px solid #845f3f";
				img2.style.border = "";
				img3.style.border = "";
				img4.style.border = "";
				
				
			};
			
			img2.onclick = function(){
				imgBig.src = img2.src;
				img2.style.border = "1px solid #845f3f";
				img1.style.border = "";
				img3.style.border = "";
				img4.style.border = "";
			};
			
			img3.onclick = function(){
				imgBig.src = img3.src;
				img3.style.border = "1px solid #845f3f";
				img2.style.border = "";
				img1.style.border = "";
				img4.style.border = "";
			};
			
			img4.onclick = function(){
				imgBig.src = img4.src;
				img4.style.border = "1px solid #845f3f";
				img2.style.border = "";
				img3.style.border = "";
				img1.style.border = "";
			};
